<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta
		  name="viewport"
		  content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover"
		/>
		<title>动态加载文件</title>
	</head>
	<body>
		<h1>除了jQuery之外，其他的js和css都是动态加载</h1>
		<div class="ball ball--first" id="ball-org"></div>
		<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.slim.min.js"></script>
		<script type="text/javascript">
			function loadCSS(url) {
				var head = document.getElementsByTagName('head')[0];
				var link = document.createElement('link');
				link.rel = 'stylesheet';
				link.type = 'text/css';
				link.href = url;
				head.appendChild(link);
			}
			        
			function loadJS(url) {
				var script = document.createElement('script');
				script.type = 'text/javascript';
				script.src = url;
				document.body.appendChild(script);
			}
			
			loadCSS('./css/common.css');
			loadCSS('./css/style.css');
			loadJS('./js/rem.js');
			loadJS('./js/app.js');
		</script>
	</body>
</html>
